if {[lsearch [info vars] mental_fsm] < 0} {
  puts " "
  puts "operate.tcl error: mental_fsm variable not found"
  puts "Its usually means, that you are using improper operate.tcl"
  puts "For example, you`ve launched mental_asr executable with"
  puts "mental fsm project folder"
} else {

  if { $mental_fsm(loaded) } {

    puts "****************************************************************"
    puts "Mentalstate core loaded"
    puts " "
    puts "Running startup script..."
    puts "Activating network interface..."
    
    fsm samplerate(local) 44100
    fsm samplerate(min)   10
    
    triggers load triggers/
    triggers bind links/
    triggers build_tree
    
    netlink open
    netlink listen
    netlink accept

  } else {
    puts "****************************************************************"
    puts "Mentalstate core failed"
    puts " "
  }

}


#netlink close

puts "****************************************************************"
puts "Entering interactive mode..."
#mkdump virt1 enable virt1.dmp
#mkdump neuro1 enable n1.dmp
#mkdump pcre1 enable pc1.dmp
#mkdump feedback_log enable fb.dmp
#netlink dump_ostream enable feedback_ostream.dmp
